import request from '@/utils/request'

// 查询旅游景点（含地区信息）列表
export function listAttraction(query) {
  return request({
    url: '/travel/attraction/list',
    method: 'get',
    params: query
  })
}

// 查询旅游景点（含地区信息）详细
export function getAttraction(attractionId) {
  return request({
    url: '/travel/attraction/' + attractionId,
    method: 'get'
  })
}

// 新增旅游景点（含地区信息）
export function addAttraction(data) {
  return request({
    url: '/travel/attraction',
    method: 'post',
    data: data
  })
}

// 修改旅游景点（含地区信息）
export function updateAttraction(data) {
  return request({
    url: '/travel/attraction',
    method: 'put',
    data: data
  })
}

//删除旅游景点（含地区信息）
export function delAttraction(attractionId) {
  return request({
    url: '/travel/attraction/' + attractionId,
    method: 'delete'
  })
}

//获取省份数据
export function getProvincesData() {
  return request({
    url: '/travel/attraction/getProvinces',
    method: 'get'
  });
}

//获取城市数据
export function getCitys(provinceCode) {
  return request({
    url: '/travel/attraction/getCitys/' + provinceCode,
    method: 'get'
  });
}

//获取景点数据
export function getAttractions(productId) {
  return request({
    url: '/travel/attraction/getAttractions/' + productId,
    method: 'get'
  });
}

//获取景点数据
export function getAttractionsByItineraryId(itineraryId) {
  return request({
    url: '/travel/attraction/getAttractionsByItineraryId/' + itineraryId,
    method: 'get'
  });
}